package com.lgc.javathread.threadPoolTest;

import java.util.Calendar;

/**
 * Created by Administrator on 2018/3/24.
 */
public class MyRunnable2 implements Runnable { //1,定义一个类实现Runnable

    private int taskNum;
    public MyRunnable2(int num)
    {
        taskNum = num;
    }

    //2,重写run方法
    @Override
    public void run() {
        Calendar calendar=Calendar.getInstance();

        try {
            Thread.sleep(1000);
        }catch (Exception e)
        {
            e.printStackTrace();
        }
        System.out.println(calendar.getTime()+"正在执行task "+taskNum+" ,"+Thread.currentThread().getName());
        //System.out.println("执行结束task "+taskNum);
    }
}
